Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

Adds --allow-domains-file flag to load allowed domains from a file instead of only accepting them via command line. Useful for managing longer domain lists.

Changes

  • CLI flag: Added --allow-domains-file <path> option
  • File parsing: Created parseDomainsFromFile() that handles:
    • One domain per line
    • Comments (lines starting with #)
    • Whitespace trimming and empty line filtering
  • Flexibility: Made --allow-domains optional; both flags can be combined with automatic deduplication
  • Error handling: Clear error messages for missing files or empty domain lists
  • Tests: 9 new unit tests covering parsing, comments, errors, and line endings

Example

# Create domains file
cat > domains.txt << EOF
# GitHub
github.com
api.github.com

# NPM
npmjs.org
EOF

# Use file alone
awf --allow-domains-file domains.txt 'curl https://api.github.com'

# Or combine with CLI domains
awf --allow-domains example.com --allow-domains-file domains.txt 'curl ...'
Original prompt

add a flag to load allowed domains (parse) from a file


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@pelikhan
Copy link

@Mossaka environment variable would be fine too

Copilot AI changed the title [WIP] Add flag to load allowed domains from file Add --allow-domains-file flag to load domains from file Oct 30, 2025
Copilot AI requested a review from Mossaka October 30, 2025 20:08
Copilot finished work on behalf of Mossaka October 30, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants